<?php
/**
 * Created by JetBrains PhpStorm.
 * User: zhouyang
 * Date: 13-9-06
 * Time: 下午4:31
 * To change this template use File | Settings | File Templates.
 */
class AdsModel extends Model{
    //根据ad_id 获取ad 信息
    public function get($ad_id){
        return $this->dbreader()->get($ad_id);
    }

    //获取推广信息 列表<带分页>
    public function getAdList($curr_page,$per_page,$filter = array()){
        return $this->dbreader()->getAdList($curr_page,$per_page,$filter);
    }

    //添加推广信息
    public function addAd($ad_type_id, $title,$summary, $link, $picture, $sort = 0, $user_id, $start_time, $end_time, $status,$note){
        return $this->dbreader()->addAd($ad_type_id,$summary, $title, $link, $picture, $sort, $user_id, $start_time, $end_time, $status,$note);
    }

    //删除推广信息
    public function delAd($ad_id){
        return $this->dbreader()->delAd($ad_id);
    }

    //修改推广信息
    public function updateAd($ad_id, $ad_type_id, $title, $link, $picture, $sort, $user_id, $start_time, $end_time, $status){
        return $this->dbreader()->updateAd($ad_id, $ad_type_id, $title, $link, $picture, $sort, $user_id, $start_time, $end_time, $status);
    }
}